#ifndef NETWORKDEFINE_H_20111222
#define NETWORKDEFINE_H_20111222

//#ifdef GAME_USERAKNET

#include "RakPeerInterface.h"
#include "BitStream.h"
#include "MessageIdentifiers.h"

enum GameIndex
{
	ID_GAME_NPC=ID_USER_PACKET_ENUM+1,
	ID_GAME_LOGING=ID_USER_PACKET_ENUM+2,
	ID_GAME_ROOMING=ID_USER_PACKET_ENUM+3,
	ID_GAME_FIGHTING=ID_USER_PACKET_ENUM+4
};

//#endif


enum RoomIndex{
	ID_ROOM_RANDOM,
	ID_ROOM_CHALLENGES,
	ID_ROOM_ACCEPT,
	ID_ROOM_REFUSE,
	ID_ROOM_SUCCESS,
	ID_ROOM_QUIT
};
enum FightIndex{
	ID_FIGHT_LEFT,
	ID_FIGHT_RIGHT,
	ID_FIGHT_DOWNATTACT,
	ID_FIGHT_UPWARDATTACT,
	ID_FIGHT_PLAYER_THIS,
	ID_FIGHT_PLAYER_ENEMY,
	ID_FIGHT_ENEMYQUIT,
	ID_FIGHT_VICTORY,
	ID_FIGHT_OVER,
	ID_FIGHT_TEST,
};
enum LoginIndex{
	ID_LOGING_LOGING,
	ID_LOGING_LOGING_SUCCESS,
	ID_LOGING_CREATENAME,
	ID_LOGING_QUIT
};

const unsigned char ID_HOST = 121;
const unsigned char ID_CLIENT = 212;
const int  USERID_MAX_LENGTH = 32;

struct BoxerInfo
{
	unsigned  short m_hp;
	char m_localName[USERID_MAX_LENGTH];
	char m_oppoName[USERID_MAX_LENGTH];
	unsigned short m_x1;
	unsigned short m_y1;
	unsigned short m_x2;
	unsigned short m_y2;
};

enum PacketType
{
	PACKET_CLIENT,
	PACKET_SREVERUPDATE,
	PACKET_OPPONENTUPDATE,
	PACKET_SERVERHURT,
	PACKET_DELAYTEST
};
enum FightAction
{
	ID_ACTION_CHANGEPOS,
    ID_ACTION_DODGE,
    ID_ACTION_DODGETONORMAL,
	ID_ACTION_LEFTFIST,
	ID_ACTION_RIGHTFIST,
	ID_ACTION_HURT
};

struct GameInfo
{
	unsigned short m_action;

	union
	{
		long m_hp1;
		long m_id;
	};

	union
	{
		long m_hp2;
		long m_hpCost;
	};	

	float xPos;
	float yPos;
};

struct ActionInfo
{
	long m_id;
	unsigned short m_action;
	float m_xPos;
	float m_yPos;
};

enum ClientSide
{
	CLIENT_SIDE_UP,
	CLIENT_SIDE_DOWN
};
enum ClientConmand
{
	COMMAND_MOVE_UP,
	COMMAND_MOVE_DOWN,
	COMMAND_MOVE_LEFT,
	COMMAND_MOVE_RIGHT,
	COMMAND_ATTACK_LEFT,
	COMMAND_ATTACK_RIGHT,
	COMMAND_DEFANSE,
	COMMAND_DEFANSECANCLE,
	COMMAND_DODGE,
	COMMAND_DODGETONORMAL
};


struct ClientPacket
{
	unsigned char m_side;
	ClientConmand m_command;
};



#endif